﻿@using DormMS.Model.ViewModels
@{
    Layout = "";
}
@model V_Member

<div class="w_percInfo" ng-controller="MemberInfoControl">
    <div class="w_pcinfo_top">
        <div class="w_pcinfo_topHead"><img src="{{Model.Avatar}}" /></div>
        <div class="w_pcinfo_topri">
            <div class="w_pcinfo_name"><span>{{Model.NickName}}</span><p class="w_pcinfo_hylevel"><img src="/Content/images/w_19.png" class="w_pcinfo_king" />{{Model.LevelDes}}</p></div>
            <div class="f_pt25">
                <ul class="w_pcinfo_progress">
                    <li ng-repeat="item in Level" ng-class="{true:'w_pcinfo_lia'+item.Id+' w_pcinfo_no',false:'w_pcinfo_lia'+item.Id}[Model.TotalPay<item.Amount]">{{item.Amount}}</li>
                </ul>

                <div class="w_pcinfo_jdt"><span style="width:{{(Model.MemberLevel-1)/4*100}}%"></span></div>
                <ul class="w_pcinfo_hy">
                    <li ng-repeat="item in Level" ng-class="{true:'w_pcinfo_hyli'+item.Id+' w_psinfo_gradeYes',false:'w_pcinfo_hyli'+item.Id}[Model.MemberLevel==item.Id]">{{item.LevelName}}</li>
                </ul>
            </div>

        </div>
    </div>
    <div class="w_pcinfo_other">
        <p class="w_pcinfo_botp">
            <span>昵称</span>
            <label>{{Model.NickName}}</label>
        </p>
        <p class="w_pcinfo_botp">
            <span>手机号</span>
            <label>{{Model.Mobile}}</label>
        </p>
        <p class="w_pcinfo_botp">
            <span>性别</span>
            <label>{{Model.SexDes}}</label>
        </p>
    </div>
    <div class="w_pcinfo_botp w_pcinfo_add" ng-click="$state.go('user.balance')">
        <span>我的余额</span>
        <a>￥{{Model.Balance}}</a>
    </div>
</div>
<script>
    App.controller('MemberInfoControl', [
        '$scope', '$state', '$route', '$rootScope', '$http',
            function ($scope, $state, $route, $rootScope, $http) {
                $scope.Model = {};
                $scope.Level = [];
                layer.load(2);
                $http.post("/UserCenter/GetMemberInfo").then(function (response) {
                    layer.closeAll('loading');
                    if (response.data.isSuccess) {
                        $scope.Model = angular.copy(response.data.data);
                    }

                });
                var tt = function () {
                    $rootScope.WxShare($rootScope.pageTitle(), '优品三悦', location.href, $rootScope.LogoUrl);
                }

                setTimeout(tt, 1000)
                $http.post("/UserCenter/GetMemberLevel").then(function (response) {
                    if (response.data.isSuccess) {
                        $scope.Level = angular.copy(response.data.data);
                    }

                });
            }
    ]);
</script>